﻿using GeoSketch2.Core;
using System.Windows.Forms;

namespace GeoSketch2.Archaeo
{
    public partial class TBDrawing : BaseToolbar
    {
        #region Constructor
        /// <summary> 
        /// The toolbar for drawing in the Archaeo module
        /// </summary>
        public TBDrawing()
        {
            InitializeComponent();

            ToolbarHeight = this.Height;

            Title = "Drawing";
        } 
        #endregion

        #region Properties
        /// <summary> 
        /// Used to disable some buttons if the drawing is not allowed
        /// </summary>
        public bool AllowDrawing
        {
            set
            {
                foreach (Control c in this.Controls)
                {
                    if (c.GetType().BaseType == typeof(BaseToolbarButton))
                    {
                        if (c.GetType() != typeof(TBBGeoTaggedImage))
                        {
                            c.Enabled = value;
                        }
                    }
                }
            }
        } 
        #endregion
    }
}
